import Data.List
--didn't work with hugs in emacs but worked fine in ghc

multiples = [[a,b,c,d,e,f] | a<-[1..], b <- [2*a], c <- [3*a], d <- [4*a], e <- [5*a], f <- [6*a] ]

findCurious (x:xs)
            | isCurious x = x
            | otherwise = findCurious xs

isCurious (x:[]) = True
isCurious (x:y:xs)
          | strx == stry = isCurious (y:xs)
          | otherwise = False
            where strx = sort $ show x
                  stry = sort $ show y

main = print $ findCurious multiples